//
//  ControlView.m
//  DrawColorPolygon
//
//  Created by 畑圭輔 on 10/03/07.
//  Copyright 2010 Keisuke Hata. All rights reserved.
//

#import "ControlView.h"


@implementation ControlView

-(void) open
{
	[UIView beginAnimations:nil context:NULL];
	[UIView setAnimationDuration:0.4f];
	
	CGRect frame = [self frame];
	
	frame.origin.y -= (frame.size.height - 80);
	float rd = 180 * (M_PI / 180.0f);
	CGAffineTransform rotate = 
	CGAffineTransformMake(cos(rd), sin(rd), -sin(rd), cos(rd), 0.0, 0.0);
	
	[openButton setTransform:rotate];
	[self setFrame:frame];
	
	[UIView commitAnimations];
	
}

-(void) close
{
	[UIView beginAnimations:nil context:NULL];
	[UIView setAnimationDuration:0.4f];
	
	CGRect frame = [self frame];
	
	frame.origin.y += (frame.size.height - 80);
	[openButton setTransform:CGAffineTransformIdentity];
	[self setFrame:frame];
	
	[UIView commitAnimations];
	
}

@end
